$FarcastKey = IniRead("Config.ini", "Keys", "Cast", "Error: Cast Key")
$ExitKey = IniRead("Config.ini", "Keys", "Exit", "Error: Exit Key")
$SwitchDelay1 = IniRead("Config.ini", "Delays", "Delay1", "Error: Delay")
$SwitchDelay2 = IniRead("Config.ini", "Delays", "Delay2", "Error: Delay2")
HotKeySet($FarcastKey, "Farcast")
HotKeySet($ExitKey, "Close")

TrayTip("FoxCast", "Set Throw as F1" & @CRLF & @CRLF & "Set Charged or Lightning Strike as F2" & @CRLF & @CRLF & "Use trigger defined in Config.ini to attack or exit the script", 10)


while 1
	Sleep(100)
WEnd

Func Farcast()
	Send("{F2}")
	sleep($SwitchDelay1)
	Send("{F1}")
	Send("{SHIFTDOWN}")
	sleep($SwitchDelay2)
	MouseDown("right")
	Sleep(100)
	MouseUp("right")
	Send("{SHIFTUP}")
EndFunc

Func Close()
Exit
EndFunc